package org.example.xinguan;

import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;
import org.example.NumberInfo;
import org.example.ResultXinguan;

import java.io.IOException;

public class XinguanReduce extends Reducer<Text, NumberInfo,Text, ResultXinguan> {
    protected void reduce(Text key,Iterable<NumberInfo> values,Context context) throws IOException, InterruptedException {
        if (values!=null){
            for (NumberInfo value :values){
                ResultXinguan res = new ResultXinguan(value);
                context.write(key,res);
            }
        }
    }
}
